<?php
include_once("../modules/checkA.php");
include_once("../../config.php");
$plate=select_one_line_all_items($table_Prefix."plate","mid = 'access_record'");
?>


<?
//用来判断当前系统属于什么板块
$system_part = $plate['mid'];

if(!$_REQUEST ['applydate'])
{
    $_REQUEST ['applydate']=date("Y-m");
}
$applydate  = addslashes($_REQUEST ['applydate']);

?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/html">
<head>
    <?php include_once(ROOT_PATH_.'/controlbase/modules/head.php'); ?>



    <style>
        body>.detail-staitics-info .agent-list li{font-size: 12px!important; width:100px;}
        body>.detail-staitics-info .layui-table td, .layui-table th{font-size: 12px!important;}
    </style>








</head>

<body>

<div id="topbar"><?php include ROOT_PATH_.'/controlbase/modules/topbar.php'; ?></div>

<div id="container" class="<? echo $system_part ?>">

    <div id="maincontent">

        <div id="sidebar">
            <?php include ROOT_PATH_.'/controlbase/modules/sidebar.php'; ?>
        </div>




        <div id="content">
            <h1>签到汇总</h1>




            <!-- 用$system_part .list_boxes来控制来到确认板块信息显示-->
            <div class="list-box">

                <div class="statistic">


                    <div class="term-select-function">
                        <label class="layui-form-label">筛选：</label>
                        <div class="layui-input-block">

<?//
//
//
//$oldest_record=select_one_line_all_items($table_Prefix."access_record","nid > 0 and applydate !='' and applydate is not null order by applydate asc");
//
//
//
//date_default_timezone_set('Asia/Shanghai');
//$first_day_of_month = date('Y-m',time()) . '-01 00:00:01';
//$t = strtotime($first_day_of_month);
//
//$oldest_month=substr($oldest_record['applydate'],0,7);
//
////如果没有数据，就吧最旧的时间当成是这个月来处理。
//if(!$oldest_month)
//{
//    $oldest_month=date("Y-m",time());
//}
//$endmark=10000;
//
//
//
//for ($i = 0; $i < $endmark; $i++) {
//
//if(date("Y-m",strtotime("-$i month",$t))==$oldest_month)
//                                {
//
//                                    $endmark=0;
//                                    $showdate[$i]=date("Y-m",strtotime("-$i month",$t));
//                                }
// else
//                                {
//
//                                     $showdate[$i]=date("Y-m",strtotime("-$i month",$t));
//                                }
//
//}
//
//
//                            ?>
<!---->
<!---->
<!---->
<!---->
<!---->
<!---->
<!--<select name="jumpMenu" id="jumpMenu" onchange="MM_jumpMenu('parent',this,0)">-->
<!---->
<!---->
<!---->
<?php
//for ($i = 0; $i < count($showdate); $i++) {
//echo $showdate[$i];
//?>
<!--    -->
<!--<option value="collect.php?applydate=--><?// echo $showdate[$i] ?><!--&nav-itemed=--><?// echo $system_part ?><!--"> --><?// echo $showdate[$i];?><!-- </option>-->
<!--                                    --><?//;}?>
<!--</select>-->



                        </div>
                    </div>


                </div>


         <br class="clearfloat"/>







<div class="detail-staitics-info"  >







<div class="list-boxes layui-form">









<?
$equipment_list=select_lines_all_items($table_Prefix."equipment","","status = '正常'","");
?>





<?

                                    for($i=0;$i<count($equipment_list);$i++)
                                    {



                                        unset($detail);unset($sum_cost);

$detail=select_lines_all_items($table_Prefix."access_record","","equipmentid = '".$equipment_list[$i]['nid']."' and status = '正常' and applydate like '%".$applydate."%'","");




                                        echo "<h2>".$equipment_list[$i]['name']."</h2>";

                                        ?>



                                        <table class="layui-table">
                                            <colgroup>
                                                <col >
                                                <col >
                                                <col >


                                            </colgroup>
                                            <thead>
                                            <tr>
                                                <th>序号</th>
                                                <th>签到日期</th>
                                                <th>金额</th>
                                            </tr>
                                            </thead>
                                            <tbody>





                                        <?php
                                        for ($ii = 0; $ii < count($detail); $ii++) {
                                            ?>

                                            <tr  >
                                                <td><?echo $ii+1 ?></td>

                                                <td><?echo $detail[$ii]['applydate'] ?></td>
                                                <td><?echo $detail[$ii]['payment']?> </td>



                                            </tr>


                                            <? $sum_cost=$sum_cost+$detail[$ii]['payment'];?>


                                            <?php
                                        ;}
                                        ?>

                                        <tr>

                                            <td> </td>
                                            <td> </td>
                                            <td>总金额：<?echo $sum_cost;?></td>


                                        </tr>

                        </tbody>
                    </table>

                         <?
                         ;}
                         ?>

























</div>
</div>


                <!--list-box end-->


            <!--content端點01-->
        </div>
        <!--maincontent端點01-->
        <br class="clearfloat"/>
    </div>
    <!--container端點01-->
</div>









<?php include_once('../modules/footer.php'); ?> </body>
</html>
